﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminPanel/AdminSite.Master" AutoEventWireup="true"
CodeBehind="EditCustomerForm.aspx.cs" Inherits="FastTrackCabService.AdminPanel.EditCustomerForm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Style/EditCustomer.css" rel="stylesheet" type="text/css"/>
    <script src="../Scripts/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.maskedinput.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function($) {
            $("#ContentPlaceHolder1_txtTel").mask("999-9999999");
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table id="tblprofile">
        <tr>
            <th colspan="2">
                <h2>
                    Customer Details
                </h2>
            </th>
        </tr>
        <asp:Panel runat="server" ID="panelPersonalCustomer">
            <tr>
                <td>
                    First Name
                </td>
                <td style="padding-left: 0">
                    Last Name
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="txtFName" runat="server" CssClass="profileTextbox" MaxLength="20"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorFName" runat="server" Text="*"
                                                ErrorMessage="First name is required" ForeColor="Red" ControlToValidate="txtFName"
                                                Display="Dynamic" ValidationGroup="profile"/>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorFName" runat="server"
                                                    Text="*" ErrorMessage="Only alphabetic characters (Min 3)" ForeColor="Red" ControlToValidate="txtFName"
                                                    ValidationExpression="^[a-zA-Z ]{3,}$" Display="Dynamic" ValidationGroup="profile"/>
                </td>
                <td style="padding-left: 0">
                    <asp:TextBox ID="txtLName" runat="server" CssClass="profileTextbox" MaxLength="20"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorLName" runat="server" ErrorMessage="Last Name is required"
                                                Text="*" ForeColor="Red" ControlToValidate="txtLName" Display="Dynamic" ValidationGroup="profile"/>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorLName" runat="server"
                                                    Text="*" ErrorMessage="Only alphabetic characters  (Min 3)" ForeColor="Red" ControlToValidate="txtLName"
                                                    ValidationExpression="^[a-zA-Z]{3,}$" Display="Dynamic" ValidationGroup="profile"/>
                </td>
            </tr>
        </asp:Panel>
        <asp:Panel runat="server" ID="panelBusinessCustomer">
            <tr>
                <td colspan="2">
                    Company Name
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:TextBox ID="txtCompanyName" runat="server" CssClass="profileTextbox" MaxLength="20"/>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorCompanyName" runat="server"
                                                Text="*" ErrorMessage="Company name is required" ForeColor="Red" ControlToValidate="txtCompanyName"
                                                Display="Dynamic" ValidationGroup="profile"/>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorCompanyName" runat="server"
                                                    Text="*" ErrorMessage="Only alphabetic characters (Min 3)" ForeColor="Red" ControlToValidate="txtCompanyName"
                                                    ValidationExpression="^[a-zA-Z ]{3,}$" Display="Dynamic" ValidationGroup="profile"/>
                </td>
            </tr>
        </asp:Panel>
        <tr>
            <td colspan="2">
                Username
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:TextBox ID="txtUname" runat="server" CssClass="profileTextboxUname" MaxLength="15"
                             Enabled="False">
                </asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Nearest branch
            </td>
        </tr>
        <tr>
            <td>
                <asp:DropDownList ID="ddlBranch" runat="server" CssClass="profileDropdown">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                E-mail
            </td>
            <td style="padding-left: 0">
                Telephone Number
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox ID="txtEmail" runat="server" CssClass="profileTextbox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorEmail" runat="server" ErrorMessage="E-Mail is required"
                                            Text="*" ForeColor="Red" ControlToValidate="txtEmail" Display="Dynamic" ValidationGroup="profile"/>
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorEmail" runat="server"
                                                Text="*" ErrorMessage="E-Mail invalid format" ForeColor="Red" ControlToValidate="txtEmail"
                                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"
                                                ValidationGroup="profile"/>
                <asp:CustomValidator ID="CustomValidatorEmail" runat="server" ErrorMessage="Email is already in use"
                                     ValidationGroup="profile" ForeColor="Red" Display="Dynamic" Text="*" OnServerValidate="CustomValidatorEmail_OnServerValidate"/>
                <asp:HiddenField ID="HiddenFieldEmail" runat="server"/>
            </td>
            <td style="padding-left: 0">
                <asp:TextBox ID="txtTel" runat="server" CssClass="profileTextbox" MaxLength="11"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorTel" runat="server" Text="*"
                                            ErrorMessage="Telephone is required" ForeColor="Red" ControlToValidate="txtTel"
                                            Display="Dynamic" ValidationGroup="profile"/>
            </td>
        </tr>
        <tr>
            <td style="text-align: center">
                <asp:Button ID="btnReset" runat="server" Text="Reset" CssClass="profileResetButton"
                            ValidationGroup="NONE" OnClick="btnReset_OnClick"/>
            </td>
            <td style="text-align: center">
                <asp:Button ID="btnUpdate" runat="server" Text="Update" CssClass="profileUpdateButton"
                            ValidationGroup="profile" OnClick="btnUpdate_OnClick"/>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <asp:Label ID="lblStatus" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <asp:ValidationSummary ID="ValidationSummary" runat="server" CssClass="ValidationSummary"
                                       ValidationGroup="profile" HeaderText="&lt;b&gt;Please fix following error(s):&lt;/b&gt;"
                                       DisplayMode="List"/>
            </td>
        </tr>
    </table>
</asp:Content>